// DatabaseManager.java
package com.example.orderfood2.DatabaseManager;

import android.content.Context;

import com.example.orderfood2.Repository.ClassInfoRepository;
import com.example.orderfood2.Repository.ManagerRepository;
import com.example.orderfood2.Repository.SchoolNewRepository;
import com.example.orderfood2.Repository.StudentAvatarRepository;
import com.example.orderfood2.Repository.StudentRepository;
import com.example.orderfood2.Repository.TeacherRepository;
import com.example.orderfood2.Repository.TimeTableRepository;


public class DatabaseManager {
    private static DatabaseManager instance;
    private final Context context;

    private DatabaseManager(Context context) {
        this.context = context.getApplicationContext();
    }

    public static synchronized DatabaseManager getInstance(Context context) {
        if (instance == null) {
            instance = new DatabaseManager(context);
        }
        return instance;
    }

    public TeacherRepository getTeacherRepository() {
        return new TeacherRepository(context);
    }

    public StudentRepository getStudentRepository() {
        return new StudentRepository(context);
    }

    public ClassInfoRepository getClassInfoRepository() {
        return new ClassInfoRepository(context);
    }

    public ManagerRepository getManagerRepository() {
        return new ManagerRepository(context);
    }

    public StudentAvatarRepository getStudentAvatarRepository() {
        return new StudentAvatarRepository(context);
    }

    public TimeTableRepository getTimeTableRepository() {
        return new TimeTableRepository(context);
    }

    public SchoolNewRepository getSchoolNewRepository() {
        return new SchoolNewRepository(context);
    }
}